package com.qf.fcy.youshare.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Alex[FR]
 * Date: 2015/2/4
 * Email: alex_fcy@163.com
 */

/**
 * 通用的 FragmentPagerAdapter
 */
public class CommonFragmentAdapter extends FragmentPagerAdapter {
    private List<Fragment> list;

    public CommonFragmentAdapter(FragmentManager fm, List<Fragment> list) {
        super(fm);
        this.list = list;
    }

    @Override
    public Fragment getItem(int position) {
        Fragment ret = null;
        if (list != null) {
            ret = list.get(position);
        }
        return ret;
    }

    @Override
    public int getCount() {
        return list.size();
    }
}
